package fun.asgc.boot.netty.db.mapper;

import com.alibaba.druid.pool.DruidDataSource;
import fun.asgc.boot.netty.annotation.Bean;
import fun.asgc.boot.netty.annotation.Component;
import fun.asgc.boot.netty.annotation.Order;
import fun.asgc.boot.netty.db.template.JdbcTemplate;

/**
 *
 * @author: aoshiguchen
 * @date: 2022/6/28
 */
@Order(0)
@Component
public class Configuration {

	@Bean
	public JdbcTemplate jdbcTemplate() {
		DruidDataSource dataSource = new DruidDataSource();
		dataSource.setUrl("jdbc:mysql://localhost:3306/test1?useUnicode=true&characterEncoding=utf8");
		dataSource.setUsername("root");
		dataSource.setPassword("YWasgc@10520");
		return new JdbcTemplate(dataSource);
	}

}
